﻿<%@ Page Language="C#" %> 

<%@ Import Namespace="System.Data" %> 
<%@ Import Namespace="System.Data.SqlClient" %> 
<script runat="server"> 
    private void Page_Load(object sender, System.EventArgs e) 
    { 
        if (!IsPostBack) LoadData(); 
    } 
    
    public void LoadData() 
    { 
        SqlDataAdapter adapter = new SqlDataAdapter("SELECT * FROM orders", "server=(local);database=northwind;Integrated Security=SSPI"); 
        DataTable table = new DataTable(); 
        adapter.Fill(table); 
        Repeater1.DataSource = table; Repeater1.DataBind(); 
    } 
 </script> 
 <HTML> <HEAD> <title>ListControls #1</title> </HEAD> <body> 
 <form id="Form1" method="post" runat="server"> 
 <asp:Repeater runat="server" id="Repeater1"> 
 <itemtemplate> 
    <b><%# DataBinder.Eval(Container.DataItem, "orderid") %></b>
     <br>Due by: <%# DataBinder.Eval(Container.DataItem, "orderdate", "{0:d}") %> 
     &nbsp;&nbsp;&nbsp; Shipped: <%# DataBinder.Eval(Container.DataItem, "shippeddate", "{0:d}") %> 
     </itemtemplate> <separatortemplate> <hr> </separatortemplate> </asp:Repeater> </form> </body> </HTML>